#include <stdio.h>
int Sum(int n)
{
	int count = 0;
	while (n)
	{
		int sz = n % 10;
		if (!sz)
		{
			count++;
		}
		n /= 10;
	}
	return count;
}
int Max(int n)
{
	int sz_1 = n % 10;
	int sz_2 = 0;
	while (n)
	{
		sz_2 = n / 10;
		if (sz_1 < (sz_2 % 10))
		{
			sz_1 = sz_2 % 10;
		}
		n /= 10;
	}
	return sz_1;
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int numer_0 = Sum(n);
	int max = Max(n);
	printf("%d %d", numer_0, max);
	return 0;
}
